package com.schoolinfo.model;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * User entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="user"
)

public class User  implements java.io.Serializable {


    // Fields    

     private String email;
     private String name;
     private String phone;
     private String qq;
     
    

	private String password;
     private Set<Report> reports = new HashSet<Report>(0);
     private Set<Goods> goodses = new HashSet<Goods>(0);


    // Constructors

    /** default constructor */
    public User() {
    }

	/** minimal constructor */
    public User(String email, String name, String phone,String password,String qq) {
        this.email = email;
        this.name = name;
        this.phone = phone;
        this.password=password;
        this.qq = qq;
    }
    
    /** full constructor */
    public User(String email, String name, String password,String phone, String qq, Set<Report> reports, Set<Goods> goodses) {
        this.email = email;
        this.name = name;
        this.phone = phone;
        this.qq = qq;
        this.reports = reports;
        this.goodses = goodses;
        
        this.password = password;
    }

   
    // Property accessors
    @Id 
    
    @Column(name="email", unique=true, nullable=false, length=50)

    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    @Column(name="name", nullable=false, length=50)

    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="phone", nullable=false, length=50)

    public String getPhone() {
        return this.phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Column(name="password",nullable=false,length=50)
    public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
    
    @Column(name="qq", length=20)

    public String getQq() {
        return this.qq;
    }
    
    public void setQq(String qq) {
        this.qq = qq;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="user")

    public Set<Report> getReports() {
        return this.reports;
    }
    
    public void setReports(Set<Report> reports) {
        this.reports = reports;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="user")

    public Set<Goods> getGoodses() {
        return this.goodses;
    }
    
    public void setGoodses(Set<Goods> goodses) {
        this.goodses = goodses;
    }
   








}